package com.siti.kindnessplatform.view.ctrl;

import com.siti.kindnessplatform.common.CommonResult;
import com.siti.kindnessplatform.view.biz.ViewBiz;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("view")
public class ViewController {

    @Resource
    ViewBiz viewBiz;

    @GetMapping(value = "viewCount")
    public CommonResult saveEncourage() {
        try {
            CommonResult result= viewBiz.viewToDb();
            return result;
        }catch (Exception e){
            return new CommonResult("error", "请求错误");

        }
    }

}
